unit FormViewDataSet;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids;

type
  TfmViewDataSet = class(TForm)
    dgMain: TDBGrid;
    dsMain: TDataSource;
  private
    { Private declarations }
    FDataSet:TDataSet;
    procedure SetDataSet(const Value:TDataSet);
  public
    { Public declarations }
    property DataSet:TDataSet read FDataSet write SetDataSet;
  end;

var
  fmViewDataSet: TfmViewDataSet;

implementation

{$R *.dfm}

{ TfmViewDataSet }

procedure TfmViewDataSet.SetDataSet(const Value: TDataSet);
begin
  if Assigned(Value) then
  begin
    FDataSet:=Value;
    dsMain.DataSet:=FDataSet;
  end;
end;

end.
